package com.scn.base.page;

import com.scn.base.constant.Constants;

/**     
 *      
 *     
 * @author GX       
 * @version 1.0     
 * @created Apr 15, 2011 7:39:34 AM    
 */

public class PageVO extends ValueObject {
	private static final long serialVersionUID = 1L;

	/**
	* 当前页
	*/
	private int curPage;
	
	/**
	* 记录总数
	*/
	private int recordCounts;
	/**
	* 记录总页数
	*/
	private int recordPages;
	/**
	* 每页记录条数
	*/
	private int pageSize=Constants.PAGESIZE;
	/**
	 * 最多显示记录数页数
	 */
	private int maxPages=Constants.MAXPAGES;
	
	public int getPageSize() {
		return pageSize;
	}
	public int getCurPage() {
		return curPage;
	}
	public void setCurPage(int curPage) {
		this.curPage = curPage;
	}
	public int getRecordCounts() {
		return recordCounts;
	}
	public void setRecordCounts(int recordCounts) {
		this.recordCounts = recordCounts;
		this.recordPages=culPage(recordCounts);
	}
	public int getRecordPages() {
		return recordPages;
	}
	public void setRecordPages(int recordPages) {
		this.recordPages = recordPages;
	}
	public int getMaxPages() {
		return maxPages;
	}
	private int culPage(int recordCounts){
		if(recordCounts%pageSize==0){
			return recordCounts/pageSize;
		}else{
			return recordCounts/pageSize+1;
		}
	}
}
